Optimal. Leaf size=65 \[ -\frac {3 b x}{2}+\frac {a \cos (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {3 b \tan (c+d x)}{2 d}-\frac {b \sin ^2(c+d x) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {2917, 2670, 14,
2671, 294, 327, 209} \begin {gather*} \frac {a \cos (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {3 b \tan (c+d x)}{2 d}-\frac {b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {3 b x}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 209
Rule 294
Rule 327
Rule 2670
Rule 2671
Rule 2917
Rubi steps
\begin {align*} \int \sin (c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx &=a \int \sin (c+d x) \tan ^2(c+d x) \, dx+b \int \sin ^2(c+d x) \tan ^2(c+d x) \, dx\\ &=-\frac {a \text {Subst}\left (\int \frac {1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}+\frac {b \text {Subst}\left (\int \frac {x^4}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {a \text {Subst}\left (\int \left (-1+\frac {1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}+\frac {(3 b) \text {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac {a \cos (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {3 b \tan (c+d x)}{2 d}-\frac {b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {(3 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac {3 b x}{2}+\frac {a \cos (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {3 b \tan (c+d x)}{2 d}-\frac {b \sin ^2(c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 63, normalized size = 0.97 \begin {gather*} -\frac {3 b (c+d x)}{2 d}+\frac {a \cos (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {b \sin (2 (c+d x))}{4 d}+\frac {b \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 94, normalized size = 1.45
method | result | size |
derivativedivides | \(\frac {a \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+b \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )}{d}\) | \(94\) |
default | \(\frac {a \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+b \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )}{d}\) | \(94\) |
risch | \(-\frac {3 b x}{2}-\frac {i b \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {i b \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i \left (-i a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) | \(102\) |
norman | \(\frac {\frac {3 b x}{2}-\frac {4 a}{d}-\frac {3 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {3 b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {3 b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {3 b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {3 b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {4 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(154\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.57, size = 62, normalized size = 0.95 \begin {gather*} -\frac {{\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} b - 2 \, a {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 61, normalized size = 0.94 \begin {gather*} -\frac {3 \, b d x \cos \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right )^{2} - {\left (b \cos \left (d x + c\right )^{2} + 2 \, b\right )} \sin \left (d x + c\right ) - 2 \, a}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right ) \sin ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 104, normalized size = 1.60 \begin {gather*} -\frac {3 \, {\left (d x + c\right )} b + \frac {4 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.97, size = 98, normalized size = 1.51 \begin {gather*} -\frac {3\,b\,x}{2}-\frac {3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+4\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________